{% extends 'base.html' %}

{% block content %}
<div class="container mt-4">
    <h2><i class="fas fa-donate"></i> 捐款记录</h2>
    <a href="{% url 'home' %}" class="btn btn-outline-primary mb-3">
        <i class="fas fa-arrow-left"></i> 返回首页
    </a>
    
    <table class="table table-striped table-bordered">
        <thead class="thead-dark">
            <tr>
                <th>捐款ID</th>
                <th>捐赠人</th>
                <th>金额</th>
                <th>捐赠日期</th>
                <th>收容所</th>
            </tr>
        </thead>
        <tbody>
            {% for donation in donations %}
            <tr>
                <td>{{ donation.donateid }}</td>
                <td>{{ donation.dname }}</td>
                <td>¥{{ donation.sum }}</td>
                <td>{{ donation.time }}</td>
                <td>{{ donation.siteid }}</td>
            </tr>
            {% empty %}
            <tr>
                <td colspan="5" class="text-center">暂无捐款记录</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}